//
//  ZYCProfileRootCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/7/16.
//

#import "ZYCProfileRootCell.h"
@interface ZYCProfileRootCell()
@property (nonatomic ,strong) UIImageView *iconView;
@property (nonatomic ,strong) UILabel *titleLabel;
@end

@implementation ZYCProfileRootCell

- (void)setDict:(NSDictionary *)dict{
    _dict = dict;
    _iconView.image = [UIImage imageNamed:dict[@"imgName"]];
    _titleLabel.text = dict[@"title"];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = HEX_RGB(kBgWhiteColor);
        self.layer.cornerRadius = 7.5;
        self.layer.masksToBounds = YES;
        [self addSubview:self.iconView];
        [self addSubview:self.titleLabel];
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(28.0, 28.0));
            make.centerX.equalTo(self);
            make.top.equalTo(self).offset(15);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.top.equalTo(self.iconView.mas_bottom).offset(2);
        }];
    }
    return self;
}

- (UIImageView *)iconView {
    if (!_iconView) {
        _iconView = [[UIImageView alloc] init];
    }
    return _iconView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 16.0) titleColor:HEX_RGB(kTitleBlackColor) textAlignment:ZZTextAlignmentCenter];
    }
    return _titleLabel;
}
@end
